package portfolio;

import com.langll.mcp.AiSpringbootMcpServerApplication;
import com.langll.mcp.portfolio.mcp.PortfolioProductMCP;
import com.langll.mcp.portfolio.service.IPortfolioProductService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;
import java.util.Map;

/**
 *  测试聊天客户端
 */
@SpringBootTest(classes = AiSpringbootMcpServerApplication.class)
@RunWith(SpringRunner.class)
public class TestService {

    @Autowired
    private IPortfolioProductService iPortfolioProductService;

    @Test
    public void getBusinessSegmentGroup(){
        List<Map<String, Object>> result =  iPortfolioProductService.getBusinessSegmentGroup("Consumer");
        for (Map<String, Object> map : result) {
            for (Map.Entry<String, Object> entry : map.entrySet()) {
                System.out.println("Key: " + entry.getKey() + ", Value: " + entry.getValue());
            }
        }
    }
}
